import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt

img=cv.imread('F:\\11\\11.jpg',1)
px=img[100,100]#读取像素点
blue=img[100,100,0]
img[100,100]=[255,255,255]
print(img.dtype)#图片编码类型
print(img.shape)#图片像素分辨率和通道数
b,g,r=cv.split(img)#拆分图形通道bgr
img=cv.merge((b,g,r))#合并图形通道
#举例(分别输出图形的bgr通道)
b=img[:,:,0]
g=img[:,:,1]
r=img[:,:,2]
cv.imshow('b',b)
cv.imshow('g',g)
cv.imshow('r',r)


plt.imshow(img[:,:,::-1])
plt.title('loutianyi'),plt.xticks([]),plt.yticks([])
plt.show()
